package com.ihmp.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "TProductInRoom", catalog = "ihmp")
public class TProductInRoom implements Serializable{
	private static final long serialVersionUID = -723583058586873479L;
	
	@Id
	@GeneratedValue
	@Column(name = "ProductInRoomId", unique = true, nullable = false)
	private Integer id;
	
	@Column(name = "ProductInRoomCode")
	private String code;
	
	@Column(name = "ProductInRoomName")
	private String name;	
	
	@Column(name = "Note")
	private String note;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="CurrencyID")
	private TCurrency currency;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Creater")
	private TUser creater;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreateDate")
	private Date createDate;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Editer")
	private TUser editer;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EditDate")
	private Date editDate;

	public Integer getId() {
		return id;
	}		

	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
		
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}			
	
	public TCurrency getCurrency() {
		return currency;
	}

	public void setCurrency(TCurrency currency) {
		this.currency = currency;
	}

	public TUser getCreater() {
		return creater;
	}

	public void setCreater(TUser creater) {
		this.creater = creater;
	}
	
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public TUser getEditer() {
		return editer;
	}

	public void setEditer(TUser editer) {
		this.editer = editer;
	}

	public Date getEditDate() {
		return editDate;
	}

	public void setEditDate(Date editDate) {
		this.editDate = editDate;
	}	
	
	
}
